package piccat.lib;

public class Index implements Cloneable {

    protected int row;
    protected int col;

    public Index(int row, int col) {
        super();
        this.row = row;
        this.col = col;
    }

    protected Index(Index other) {
        super();
        this.row = other.row;
        this.col = other.col;
    }

    public int getRow() {
        return row;
    }

    public int getCol() {
        return col;
    }

    protected void set(Index other) {
        this.row = other.row;
        this.col = other.col;
    }

    @Override
    public String toString() {
        StringBuffer buf = new StringBuffer();
        buf.append('(').append(row).append(',').append(col).append(')');
        return buf.toString();
    }

    @Override
    protected Index clone() {
        return new Index(this);
    }
}
